portableSql
AddYearsToDate Portable SQL Function
Syntax
AddYearsToDate as D (Date as D, NrOfYears as N)
Arguments
- DateDate
A field or value.
- NrOfYearsNumeric
Number of years to add.
Returns
- resultDate
Returns a date NrOfYears ahead of Date.
Description
Get the date value NrOfYears years ahead of Date.
Discussion
The AddYearsToDate function computes a new date by adding years to a date field.
AddYearsToDate() function executed on the Northwind Access database
SELECT FIRST 1 CurrentDate() AS Now, AddYearsToDate(CurrentDate(), 1) AS Expr1 FROM Orders =10/10/2019 12:00:00 00 am|10/10/2020 12:00:00 00 am